The present invention relates to adjusting colors in digital images.
In a digital image, colors are represented by a set of color components of a color space. Examples of color spaces include RGB colors using red, green, and blue (“RGB”) components; CMYK colors using cyan, magenta, yellow, and black (“CMYK”) components; or Lab colors using scientifically defined components. A color space is typically finite and restricted to a representable range of values in each color component. For example, an RGB color space can be represented by a “cube” where each component has a value between 0.0 and 1.0.
Colors in digital images can be adjusted by using computer based technologies, such as the Adobe® Photoshop® image editing software, available from Adobe Systems Incorporated of San Jose, Calif., to achieve coloring effects, corrections, or color matching in different images. For example, image contrast can be increased by “stretching out” colors in a limited region to a larger region in a color space that represents colors in the image. Similarly, the image contrast can be decreased by “compressing” a region in the color space. Alternatively, colors can be “cast,” i.e., biased, to make an image, e.g., greener; inversely, a color cast in an image can be corrected or removed.
A color adjustment can be generated by a color mapping that associates colors in the image with mapped colors. Based on the associated mapped color, a color in the image can be adjusted, i.e., replaced with the mapped color, if the mapped color can be represented in the image. When a color mapping provides a mapped color that is outside of the color space, e.g., a RGB component is out of the available range of 0.0 to 1.0, the mapped color is typically “clipped” to a color within (e.g., at the boundary of) the color space. For example, a negative RGB value can be clipped to, i.e., replaced with, 0.0 due to the adjustment. As a result of the clipping, information may be lost in the adjusted image when originally distinct colors are clipped to the same color.